# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WalletObjects.V1.Model.RotatingBarcodeValues do
  @moduledoc """
  A payload containing many barcode values and start date/time.

  ## Attributes

  *   `periodMillis` (*type:* `String.t`, *default:* `nil`) - Required. The amount of time each barcode is valid for.
  *   `startDateTime` (*type:* `String.t`, *default:* `nil`) - Required. The date/time the first barcode is valid from. Barcodes will be rotated through using period_millis defined on the object's RotatingBarcodeValueInfo. This is an ISO 8601 extended format date/time, with an offset. Time may be specified up to nanosecond precision. Offsets may be specified with seconds precision (even though offset seconds is not part of ISO 8601). For example: `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 hours before UTC (same instant in time as the above example). If the event were in New York, this would be the equivalent of Eastern Daylight Time (EDT). Remember that offset varies in regions that observe Daylight Saving Time (or Summer Time), depending on the time of the year.
  *   `values` (*type:* `list(String.t)`, *default:* `nil`) - Required. The values to encode in the barcode. At least one value is required.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :periodMillis => String.t() | nil,
          :startDateTime => String.t() | nil,
          :values => list(String.t()) | nil
        }

  field(:periodMillis)
  field(:startDateTime)
  field(:values, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.WalletObjects.V1.Model.RotatingBarcodeValues do
  def decode(value, options) do
    GoogleApi.WalletObjects.V1.Model.RotatingBarcodeValues.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WalletObjects.V1.Model.RotatingBarcodeValues do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
